﻿using AntDesign;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Client.UI.Components;

public partial class ErrorContent
{
    [NotNull]
    [Inject]
   private ILogger<ErrorContent>? Logger { get; set; }

    [NotNull]
    [Inject]
    private MessageService? MessageService { get; set; }


    protected override async Task OnErrorAsync(Exception ex)
    {
        Logger.LogError("Error:ProcessError - Type: {Type} Message: {Message}", ex.GetType(), ex.Message);

        await MessageService.Error(ex.Message);
    }
}
